#include "time.h"

sfr16 RCAP4 = 0xE4;               
sfr16 TMR4 = 0xF4; 
void timer3_init()
{
	TMR3CN = 0x00;
	TMR3RLL = 0xdc;//100hz
	//TMR3RLL = 0xfc;
	TMR3RLH = 0Xef;
	TMR3L = 0Xff;
	TMR3H = 0Xff; 
	EIE2 |= 0x01;
	TMR3CN |= 0x04;
	EIE2&=0xFE;
}
void TIMER4_Init (int counts)
{   
   T4CON = 0x00;                       // Stop Timer4; Clear overflow flag (TF4);
                                       // Set to Auto-Reload Mode

   
   CKCON |= 0x40;                      // Timer4 counts SYSCLKs

   RCAP4 = -counts;                    // Set reload value
   TMR4 = RCAP4;                       // Initialzie Timer4 to reload value

   EIE2 |= 0x04;                       // Enable Timer4 interrupts
   T4CON |= 0x04;                      // Start Timer4

}

